package controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import pojo.HandSet;
import service.HandSetService;

import java.util.List;

public class HandSetController {
    @Autowired
    private HandSetService handSetService;
    @RequestMapping(value = "/list")
    public String handList(Model model){
        List<HandSet> list = handSetService.list();
        model.addAttribute("list",list);
        return "index";
    }
    @RequestMapping(value = "/findId")
    public String findId(Model model,int hsId){
        HandSet handSet = handSetService.findId(hsId);
        model.addAttribute("handSet",handSet);
        return "query";
    }
    @RequestMapping(value = "/delete")
    public String delete(int hsId){
        int result = handSetService.delete(hsId);
        return "index";
    }
}
